﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DingHeng.TransportationManagement.Entity.Constant;

namespace DingHeng.TransportationManagement.Business
{
    public class Common
    {
        public string ShiftTypeCalculate(DateTime dt, out DateTime shiftDate)
        {
            if (DateTime.Now.Hour >= 0 && dt.Hour < 8)
            {
                shiftDate = DateTime.Now.AddDays(-1).Date;
                return StringConstant.ShiftTypeNight;
            }
            else
            {
                shiftDate = DateTime.Now.Date;
                if (DateTime.Now.Hour >= 8 && DateTime.Now.Hour < 20)
                {
                    return StringConstant.ShiftTypeDay;
                }
                else
                {
                    return StringConstant.ShiftTypeNight;
                }
            }
        }
    }
}
